let leaveModel = require("../model/LeaveSchma"); //引入表

module.exports = {
  add: (list) => {//新增的数据的功能
    return leaveModel.insertMany(list);//insertMany做批量新增支持单个新增
  },
  query:params=>leaveModel.find(params),
  queryall:(params,skip,limit)=>leaveModel.find(params).skip(skip).limit(limit),//分页
  update:(newvalue,oldvalue)=>leaveModel.update(newvalue,oldvalue),//更新数据
  count:(params)=>leaveModel.count(params)//查询数据总数
};